'''
# -*- coding:utf-8 -*-
# @Project: DevOps_api
# @Date: 2023/3/20 - 19:07
# @Author: ysg
# @Describe: 

serializer.py
'''

from rest_framework.viewsets import GenericViewSet
from rest_framework import serializers
from alarm.models import Alarm_info


class AlarmInfoModelSerializerr(serializers.ModelSerializer):
    class Meta:
        model = Alarm_info
        fields = ['id', 'alarm_name', 'alarm_info', 'alarm_time', 'edit_user', 'is_handle', 'is_ignore',
                  'edit_user_name', 'is_handle_name', 'is_ignore_name']
        extra_kwargs = {
            'edit_user_name': {'read_only': True},
            'is_handle_name': {'read_only': True},
            'is_ignore_name': {'read_only': True},
        }
